﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ShaderSelection.ascx.cs" Inherits="Admin_Asp_UserControls_ShaderSelection" %>

<asp:Panel runat="server" CssClass="selection">
    <div class="notice">   
        <p>
            Here you can add or remove shaders that the model can be rendered with. Availible shaders are: <br />
            <strong>Phong:</strong> Standard phong shader <a href="http://en.wikipedia.org/wiki/Phong_shading" target="_blank" >Phong Shading</a> <br />
            <strong>Wireframe:</strong> Renders the model in <a href="http://en.wikipedia.org/wiki/Wire-frame_model" >wireframe </a> mode. Currently NOT implemented.
        </p>
    </div> 
    <div class="selection_content">
        <h3>Edit Shaders</h3>
        <asp:Button ID="x_closeSelection" runat="server" OnClick="CloseSelection" Text="Hide Edit Shaders" /><br />

        <label class="labelHeader" >Shaders:</label> <br />
        <asp:DataList ID="x_selectedShaders" runat="server"  RepeatDirection="Horizontal" RepeatColumns="10" OnItemCommand="selectedShaders_ItemCommand">
            <ItemTemplate>            
                <asp:LinkButton runat="server" CommandName="select" CssClass="thumbnailHeader" >
                    <div class="thumbnailHeader">
                        <p><%# Eval("shaderType") %></p>
                    </div>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval(Strings.Selection_ImageSrc,"~/Admin/Images/{0}") %>' CssClass="thumbnail centerMe"  /> 
                </asp:LinkButton>            
            </ItemTemplate>
            <SelectedItemStyle BorderColor="Red" BorderWidth="2" />
            <SelectedItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="unselect" CssClass="thumbnailHeader" >
                    <div class="thumbnailHeader">
                        <p id="x_selectionShaders_shaderType" runat="server"><%# Eval("shaderType") %></p>
                    </div>
                    <asp:Image runat="server" ImageUrl='<%# Eval(Strings.Selection_ImageSrc,"~/Admin/Images/{0}") %>' CssClass="thumbnail centerMe" /> 
                </asp:LinkButton>
            </SelectedItemTemplate>
        </asp:DataList>
        <br />
        <asp:Panel ID="x_selectedShadersPanel" runat="server" Visible="false">
            <asp:Button ID="x_selectedShaders_remove" runat="server" Text="Remove Shader" OnClick="RemoveShader" />
        </asp:Panel>
        <br />

        <label class="labelHeader">Add a shader</label><br />
        <asp:DataList ID="x_addShaders" runat="server" OnItemCommand="addShaders_ItemCommand" RepeatDirection="Horizontal" RepeatColumns="10">
          
            <ItemTemplate>            
                <asp:LinkButton runat="server" CommandName="select" CssClass="thumbnailHeader" >
                    <div class="thumbnailHeader">
                        <p><%# Eval("shaderType") %></p>
                    </div>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("imageSrc","~/Admin/Images/{0}") %>' CssClass="thumbnail centerMe" /> 
                </asp:LinkButton>
            
            </ItemTemplate>
            <SelectedItemStyle BorderColor="Red" BorderWidth="2" />
            <SelectedItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="unselect" CssClass="thumbnailHeader" >
                    <div class="thumbnailHeader">
                        <p id="x_addShaders_shaderType" runat="server"><%# Eval("shaderType") %></p>
                    </div>
                    <asp:Image runat="server" ImageUrl='<%# Eval("imageSrc","~/Admin/Images/{0}") %>' CssClass="thumbnail centerMe" /> 
                </asp:LinkButton>
            </SelectedItemTemplate>
        </asp:DataList><br />
    
        <asp:Panel ID="x_addShadersPanel" runat="server" Visible="false">
            <asp:Button ID="x_addShaders_remove" runat="server" Text="Add Shader" OnClick="AddShader" />
        </asp:Panel>
    </div>
</asp:Panel>